<template>
	<view class="page">
		<view class="between">
			<view class="title">
				发现
			</view>
			<view class="icon">

			</view>
		</view>
		<view class="content">
             <list :list="items"></list>
		</view>
	</view>
</template>
<script>
	import list from './core/item.vue'
	export default {
		components: {
         list
		},
		props: {

		},
		data(){
			return{
				items:[{
					goods_main_pic:'https://via.placeholder.com/300x400.png',
				}]
			}
		},
		created() {
			function getRandomNum(min, max) {
			    return Math.floor(Math.random() * (max - min + 1) + min);
			}
			
			// 定义空数组，用于接收随机数
			var arr = [];
			 
			for (var i = 0; i < 10; i++) {
				var x = getRandomNum(50, 160)
				let e = {
					goods_main_pic : `https://via.placeholder.com/${x}x${x}.png`
				}
			    arr.push(e);
			} 
			
			this.items = arr
		},
	}
</script>
<style lang="scss" scoped> 
 
.item{
    width: 40vw;
	border: 1px solid;
}
.item:nth-child(n){
    float: left;
}
.item:nth-child(2n){
    float: right;
}
</style>
